package com.svms.service.vo;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author om39a
 * 
 */
public class IndentVO implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public String indentId; // --> For my own reference -> Internal Primary key
	public Date indentDate;
	public String invoiceNumber; // --> Invoid Number or Bill number which will
									// be used in bill break down
	public Date invoiceDate;
	public AddressVO address;
	public List<VehicleSpareVO> billItems;
	public String indendAmountPayable;
	public String createdUser;
	public String approvalManager;
	public boolean isApproved;
	public ResultCodeVO resultCode;
	public String amount;

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getIndentId() {
		return indentId;
	}

	public void setIndentId(String indentId) {
		this.indentId = indentId;
	}

	public Date getIndentDate() {
		return indentDate;
	}

	public void setIndentDate(Date indentDate) {
		this.indentDate = indentDate;
	}

	public String getInvoiceNumber() {
		return invoiceNumber;
	}

	public void setInvoiceNumber(String invoiceNumber) {
		this.invoiceNumber = invoiceNumber;
	}

	public Date getInvoiceDate() {
		return invoiceDate;
	}

	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	public AddressVO getAddress() {
		return address;
	}

	public void setAddress(AddressVO address) {
		this.address = address;
	}

	public List<VehicleSpareVO> getBillItems() {
		return billItems;
	}

	public void setBillItems(List<VehicleSpareVO> billItems) {
		this.billItems = billItems;
	}

	public String getIndendAmountPayable() {
		return indendAmountPayable;
	}

	public void setIndendAmountPayable(String indendAmountPayable) {
		this.indendAmountPayable = indendAmountPayable;
	}

	public String getCreatedUser() {
		return createdUser;
	}

	public void setCreatedUser(String createdUser) {
		this.createdUser = createdUser;
	}

	public String getApprovalManager() {
		return approvalManager;
	}

	public void setApprovalManager(String approvalManager) {
		this.approvalManager = approvalManager;
	}

	public boolean isApproved() {
		return isApproved;
	}

	public void setApproved(boolean isApproved) {
		this.isApproved = isApproved;
	}

	public ResultCodeVO getResultCode() {
		return resultCode;
	}

	public void setResultCode(ResultCodeVO resultCode) {
		this.resultCode = resultCode;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((address == null) ? 0 : address.hashCode());
		result = prime * result + ((amount == null) ? 0 : amount.hashCode());
		result = prime * result
				+ ((approvalManager == null) ? 0 : approvalManager.hashCode());
		result = prime * result
				+ ((billItems == null) ? 0 : billItems.hashCode());
		result = prime * result
				+ ((createdUser == null) ? 0 : createdUser.hashCode());
		result = prime
				* result
				+ ((indendAmountPayable == null) ? 0 : indendAmountPayable
						.hashCode());
		result = prime * result
				+ ((indentDate == null) ? 0 : indentDate.hashCode());
		result = prime * result
				+ ((indentId == null) ? 0 : indentId.hashCode());
		result = prime * result
				+ ((invoiceDate == null) ? 0 : invoiceDate.hashCode());
		result = prime * result
				+ ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
		result = prime * result + (isApproved ? 1231 : 1237);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		IndentVO other = (IndentVO) obj;
		if (address == null) {
			if (other.address != null)
				return false;
		} else if (!address.equals(other.address))
			return false;
		if (amount == null) {
			if (other.amount != null)
				return false;
		} else if (!amount.equals(other.amount))
			return false;
		if (approvalManager == null) {
			if (other.approvalManager != null)
				return false;
		} else if (!approvalManager.equals(other.approvalManager))
			return false;
		if (billItems == null) {
			if (other.billItems != null)
				return false;
		} else if (!billItems.equals(other.billItems))
			return false;
		if (createdUser == null) {
			if (other.createdUser != null)
				return false;
		} else if (!createdUser.equals(other.createdUser))
			return false;
		if (indendAmountPayable == null) {
			if (other.indendAmountPayable != null)
				return false;
		} else if (!indendAmountPayable.equals(other.indendAmountPayable))
			return false;
		if (indentDate == null) {
			if (other.indentDate != null)
				return false;
		} else if (!indentDate.equals(other.indentDate))
			return false;
		if (indentId == null) {
			if (other.indentId != null)
				return false;
		} else if (!indentId.equals(other.indentId))
			return false;
		if (invoiceDate == null) {
			if (other.invoiceDate != null)
				return false;
		} else if (!invoiceDate.equals(other.invoiceDate))
			return false;
		if (invoiceNumber == null) {
			if (other.invoiceNumber != null)
				return false;
		} else if (!invoiceNumber.equals(other.invoiceNumber))
			return false;
		if (isApproved != other.isApproved)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "IndentVO [indentId=" + indentId + ", indentDate=" + indentDate
				+ ", invoiceNumber=" + invoiceNumber + ", invoiceDate="
				+ invoiceDate + ", address=" + address + ", billItems="
				+ billItems + ", indendAmountPayable=" + indendAmountPayable
				+ ", createdUser=" + createdUser + ", approvalManager="
				+ approvalManager + ", isApproved=" + isApproved
				+ ", resultCode=" + resultCode + ", amount=" + amount + "]";
	}

}
